package Server;

// TODO : 最终不需要在内存中存储, 应该要存储到数据库中
public abstract class User {
    public static final int NOT_EXIST = 0;
    public static final int SUPERADMIN = 1;
    public static final int ADMIN = 2;
    public static final int MANAGER = 3;
    public static final int GUEST = 4;  //代表Room
    private int userType;        // 用户类型
    private String userName;
    private String passwd;
    private boolean status;     // 当前状态, online为true, offline为false
    private String token;

    public User(int userType, String userName, String passwd) {
        this.userType = userType;
        this.userName = userName;
        this.passwd = passwd;
    }

    public int getUserType() {
        return userType;
    }

    public void setUserType(int userType) {
        this.userType = userType;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}

class Admin extends User {//空调管理员

    Admin(String userName, String passwd) {
        super(ADMIN, userName, passwd);
    }
}

class Manager extends User {//酒店经理

    Manager(String userName, String passwd) {
        super(MANAGER, userName, passwd);
    }
}

//// 房客不设账号密码
//class Guest extends User {
//    Guest() {
//        super(GUEST, null, null);
//    }
//}
